Technical Q&A PLAT18
Diagnosing a Hang in vSyncWait


Q: How can I diagnose a hang in vSyncWait?

A: When you break into MacsBug and find you are in the vSyncWait loop, issue the command:

	dm a0 iopb

This will show you the parameter block being examined in the vSyncWait loop with formatted output.

Look at the ioRefNum field (24 bytes into the structure.) This word contains the driver reference number for the driver you are waiting on. For purposes of this example, assume the driver reference number is FFDF.

Enter the command:

	drvr FFDF.w

and you will be given information about that particular driver, including its name, where the i/o queue begins, etc. You can then use this information to track down your problems.

Entering the command:

	drvr

without any arguments will give you a list of all the drivers in the system. The short cut for all the above is to use the MacsBug command:

	drvr (a0+18)^.w

Further References:

  • MacsBug Reference and Debugging Guide, Apple Computer (Addison-Wesley). ISBN 0-201-56768-7
  • How to Write Macintosh Software, by Scott Knaster (Addison-Wesley). ISBN 0-201-60805-7
  • Debugging Macintosh Software with MacsBug, by Othmer & Straus (Addison-Wesley). ISBN 0-201-58134-5

[Feb 15 1996]


Developer Documentation | Technical Notes | Development Kits | Sample Code